package com.zygh.interactiveplatform.module.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zygh.interactiveplatform.common.constant.EmployeeResponseCodeConst;
import com.zygh.interactiveplatform.common.domain.ResponseDTO;
import com.zygh.interactiveplatform.module.entity.DataAccessTop10;
import com.zygh.interactiveplatform.module.entity.DataInteractionTrend;
import com.zygh.interactiveplatform.module.mapper.DataAccessTop10Mapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zygh.interactiveplatform.module.mapper.DataInteractionTrendMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lee
 * @since 2021-02-02
 */
@Service
public class DataAccessTop10Service extends ServiceImpl<DataAccessTop10Mapper, DataAccessTop10> {
    @Resource
    private DataAccessTop10Mapper dataAccessTop10Mapper;

    public ResponseDTO findDataAccessTop10AllDay() {
        DataAccessTop10 dataAccessTop10AllDay = dataAccessTop10Mapper.findDataAccessTop10Last();
        if (dataAccessTop10AllDay != null) {
            return ResponseDTO.succData(dataAccessTop10AllDay);
        }
        return ResponseDTO.wrap(EmployeeResponseCodeConst.EMPTY_INFORMATION_ERROR);
    }
}
